<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddProductSpecsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//规格
		Schema::create('specificant', function(Blueprint $table){
			$table->increments('id');
			$table->string('name', 50);//名称
			$table->integer('type');
			$table->string('default',50);//默认值
			$table->string('specs',200);
		});
		//规格项
		Schema::create('spec_option', function (Blueprint $table ){
			$table->increments('id');
			$table->string('name', 50);
			$table->string('value',50);
			//$table->tinyInteger('checked')->defaults(0);
			$table->smallInteger('sort')->defaults(0);
			$table->integer('specificant_id');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
	}

}
